<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
</head>
<body>

<form action="/api/tagging/user/register" method="post">
    <input type="text" name="username">
    <input type="text" name="password">
    <input type="text" name="code">
    <input type="submit" value="Register">
</form>

<input type="text" id="email"/>
<button id="btnEmail">获取验证码</button>


</body>
<script>
    let elementById = document.getElementById(`btnEmail`);
    elementById.onclick = function () {
        let elementById1 = document.getElementById("email");
        const email = elementById1.value;
        console.log(email);
        fetch("/api/tagging/user/emailCode", {
            method: "POST",
            body: "username=" + email,
            headers: {
                'content-type': 'application/x-www-form-urlencoded'
            }
        }).then(data => {
            console.log(data);
            return data.json();
        }).then(res => {
            console.log(res);
        });
    }

</script>
</html>